package server.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import server.business.pojo.RhType;
import server.business.service.RhTypeService;
import server.business.utils.Result;

import java.util.List;


@Controller
@RequestMapping("/rhType")
public class RhTypeController {
    @Autowired
    private RhTypeService rhTypeService;

    /**
     * 查询RH血型
     */
    @RequestMapping("/normal/queryRhType")
    @ResponseBody
    public Result queryRhType() {
        rhTypeService.list();
        Result result = new Result();
        result.setCode("200");
        result.setData(rhTypeService.list());
        return result;
    }
    /**
     * 获取Rh血型数据字典myq
     */
    @GetMapping("/normal/type")
    @ResponseBody
    public List<RhType> getRhType() {

        return rhTypeService.list();
    }

    @RequestMapping("/normal/query")
    @ResponseBody
    public List<RhType> queryData(){
        List<RhType> list = rhTypeService.queryData();
        return list;
    }


    @GetMapping(value = "/normal/getName")
    @ResponseBody
    public server.business.utils.results.lrz.Result getName() {
        List<RhType> rhTypeList = rhTypeService.list();
        return server.business.utils.results.lrz.Result.success(rhTypeList);
    }
}
